package com.tengju.user.domain.model.user;

import java.util.Arrays;

/**
 * @author kezunfa
 * @date 2021/4/22 20:33
 *  用户升级类型枚举
 */
public enum UserApplayTypeEnum {

    REGIST(0,"注册"),


    TOPUP(1, "充值"),

    /* VIP */
    ACTITY(2, "活动礼包"),

    /* VVIP */
    PERFORMANCE(3, "业绩"),

    /* SVIP */
    RECRUIT(4, "招募"),

    /* 黑卡 */
    DEMOTION(5, "降级"),

    SCORE(6, "积分"),

    SIGN(7, "签约");

    private int code;
    private String type;

    private UserApplayTypeEnum(int code, String type) {
        this.code = code;
        this.type = type;
    }

    public int getCode() {
        return code;
    }

    public String getType() {
        return type;
    }


    public static UserApplayTypeEnum getByCode(int code) {
        return Arrays.stream(UserApplayTypeEnum.values()).filter(k->k.getCode() == code)
                .findFirst().orElse(null);
    }
}
